from django.contrib import admin
from worlddb.models import *

class CountryAdmin(admin.ModelAdmin):
  list_display = ('name', 'pk',)
  search_fields = ['name']
admin.site.register(Country, CountryAdmin)

class RegionAdmin(admin.ModelAdmin):
  list_display = ('name', 'country', 'pk',)
  search_fields = ['name', 'country__name',]
admin.site.register(Region, RegionAdmin)

class CityAdmin(admin.ModelAdmin):
  list_display = ('name', 'region',)
  search_fields = ['name', 'region__name',]
  raw_id_fields = ('region',)
admin.site.register(City, CityAdmin)
